<?php
include_once(dirname(__FILE__)."/../../src/meta_data_handler.php");
include_once(dirname(__FILE__)."/../../src/config.inc.php");


class Test009 extends UnitTestCase
{
 function test()
 {
 	MYSQL_CONNECT(DB_SERVER,DB_USER_NAME,DB_USER_PASSWORD) OR DIE("Datenbankverbindung konnte nicht hergestellt werden!");
	@mysql_select_db(DB_NAME) or die("Datenbank nicht gefunden!"); 
	
	$metadata = new InsertMetaData();
	$metadata->insertData('Title', 'Author', '2000-06-06', '2000-06-10', 'Description', 'tag1', 'tag2', 'tag3', 'tag4', 'tag5');

 	$query =  "Select * FROM metadata WHERE title = 'Title' AND author = 'Author' AND creation_date = '2000-06-06'";
 	$query .= "AND last_edit = '2000-06-10' AND description = 'Description' AND tag1 = 'tag1'";
 	$query .= "AND tag2 = 'tag2' AND tag3 = 'tag3' AND tag4 = 'tag4' AND tag5 = 'tag5'";
  $result = MYSQL_QUERY($query);
	$num_rows =  mysql_num_rows($result);
 	$this->assertNotNull($num_rows);
 }
}
?>

